<?php

declare(strict_types=1);

namespace MonologMysql\Repository;

use Hyperf\Database\ConnectionInterface;

class HyperfRecordRepositoryImpl implements RecordRepository
{
    protected ConnectionInterface $connection;

    protected string $table;

    public function __construct(ConnectionInterface $connection, string $table)
    {
        $this->connection = $connection;
        $this->table = $table;
    }

    public function insert(array $record): void
    {
        $this->connection->table($this->table)->insert($record);
    }
}